package cn.cloudtogo.support.mysql.column;

import cn.cloudtogo.common.Assert;
import lombok.Data;

/**
 * @author yaolianhua789@gmail.com
 **/
@Data
public class Types {

    private ColumnType columnType;
    private String length;
    private String decimals;

    public static Types of(ColumnType columnType) {
        Assert.notNull(columnType, () -> "column type is null");
        Types types = new Types();
        types.setColumnType(columnType);
        return types;
    }

    public enum ColumnType {
        //type

        BIT,
        TINYINT,
        SMALLINT,
        INT,
        BIGINT,
        FLOAT,
        DECIMAL,
        CHAR,
        DOUBLE,
        VARCHAR,
        TEXT,
        MEDIUMTEXT,
        TINYTEXT,
        LONGTEXT,
        BLOB,
        DATE,
        TIME,
        YEAR,
        TIMESTAMP,
        DATETIME
    }

}
